﻿using EcoSystem.Enums;
using System.ComponentModel.DataAnnotations;

namespace EcoSystem
{
    /// <summary>
    /// 添加或更新的DTO
    /// </summary>
    public class CreateOrUpdateConfigSettingDto
    {
         /// <summary>
         /// 分类
         /// </summary>
         public string Category {get;set;}

        /// <summary>
        /// 键名
        /// </summary>
        [Required(ErrorMessage ="key不能为空")]
        public string Key {get;set;}

        /// <summary>
        /// 前端传递的键值
        /// </summary>
        public object KeyValue { get; set; }

        /// <summary>
        /// 后端处理的键值
        /// </summary>
        public string Value {get;set;}

        /// <summary>
        /// 级别
        /// </summary>
        [Required(ErrorMessage = "级别不能为空")]
        public ConfigLevel Level {get;set;}

        /// <summary>
        /// 用户代码
        /// 用户级时存用户id，全局或系统级时为空字符串
        /// </summary>
        public string ProviderKey {get;set;}

         /// <summary>
         /// 系统模块代码
         /// </summary>
         public string ModuleCode {get;set;}

         /// <summary>
         /// 用途(前端或后端)
         /// </summary>
         public Usage Usage {get;set;}
    }
}
